package com.qfedu.edu.pojo;

import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

@Entity
@Data
@Table(name = "t_user")
@TableName("t_user")
@AllArgsConstructor
@NoArgsConstructor
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
//    @TableField("id")
    @ApiModelProperty("用户id")
    private Integer id = 0;
    @ApiModelProperty("用户名")
    private String username;
    //    @JsonIgnore
    @ApiModelProperty("密码")
    private String password;
    @ApiModelProperty("性别")
    private Integer sex;
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("创建时间")
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("更新时间")
    private Date updateTime;
    @ApiModelProperty("逻辑删除")
    @TableLogic
    private Integer deleted;
    @ApiModelProperty("状态")
    private Integer status;
    @ApiModelProperty("离线乐观锁")
    @Version
    private Integer version;
}
